package com.ibeetl.cms.service;

import java.util.List;

import com.ibeetl.admin.core.entity.CoreRole;
import com.ibeetl.cms.web.query.BuyHouseSubsidiesQuery;
import com.ibeetl.cms.web.query.IndustrialTalentsQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.ibeetl.cms.dao.IndustrialTalentsDao;
import com.ibeetl.cms.entity.IndustrialTalents;
import com.ibeetl.admin.core.service.BaseService;

/**
 * IndustrialTalents Service
 */

@Service
@Transactional
public class IndustrialTalentsService extends BaseService<IndustrialTalents>{

    @Autowired
    private IndustrialTalentsDao industrialTalentsDao;
    //查个人
    public PageQuery<IndustrialTalents>queryByCondition(PageQuery query){
        PageQuery ret =  industrialTalentsDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }
    //查企业
    public PageQuery<IndustrialTalents>findenterprise(PageQuery query){
        PageQuery ret =  industrialTalentsDao.findenterprise(query);
        queryListAfter(ret.getList());
        return ret;
    }


    public void batchDelIndustrialTalents(List<Long> ids){
        try {
            industrialTalentsDao.batchDelIndustrialTalentsByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除IndustrialTalents失败", e);
        }
    }

    public List<IndustrialTalents> queryCompany(IndustrialTalentsQuery condtion) {
        List<IndustrialTalents> ret =  industrialTalentsDao.queryCompany(condtion);
        queryListAfter(ret);
        return ret;
    }

    public PageQuery<IndustrialTalents> queryEmployees(PageQuery page) {
        page.setPageSize(Integer.MAX_VALUE);

        page.setPageSize(Integer.MAX_VALUE);
        PageQuery ret =  industrialTalentsDao.queryEmployees(page);
        queryListAfter(ret.getList());
        return ret;

    }
    public PageQuery<IndustrialTalents> queryDoneTask(PageQuery page) {
        PageQuery ret =  industrialTalentsDao.queryDoneTask(page);
        queryListAfter(ret.getList());
        return ret;

    }

    public int queryEmployeesCount(IndustrialTalentsQuery query) {
        return industrialTalentsDao.queryEmployeesCount(query);
    }

    public List<IndustrialTalents> findIndustrial(List<Long> ids) {
        return industrialTalentsDao.findIndustrial(ids);
    }

}